<%@page language="java" pageEncoding="UTF-8"%>
<%@include file="/views/common/include/taglib.jsp"%>
<link type="text/css" rel="stylesheet" href="${ctx }/css/dlifestyle/sectionparent.css" source="widget" />
<link type="text/css" rel="stylesheet" href="${ctx }/css/dlifestyle/admin.css" source="widget" />
<script src="${ctx}/js/controllers/news/helpmanual/HelpManualEditController.js" type="text/javascript"></script>
<style>
   	select{
   		padding-left: 18px;
   		font-size: 14px;
		border-radius: 10px;
		width:83%;
		margin-top: 4px;
		background-image: none;
		border: 1px solid #E5E5E5;
		color:#8b8787;
   	}
</style>
 <section>
 	<div style="height:40px;line-height: 40px;">
   		 <div class="forword_area"></div>
   		 <div class="location">当前位置：${sessionScope.currcent_position}</div>
    </div>
         <hr>       
  	 <div class="panel panel-default">
		<div class="editTitle">
			<div style="height: 41px;width:190px;float:left;">
				<img style="float:left;margin-left:37px;margin-top:9.5px;" src="${ctx}/images/new_edit.png" />
 				<c:if test="${type == 1 }">
 					<c:choose>
 					<c:when test="${pageType == 1 }">
						<h4>新增帮助手册</h4>
 					</c:when>
 					<c:when test="${pageType == 2 }">
 						<h4>新增报修信息</h4>
 					</c:when>
 					</c:choose>
		        </c:if>
 				<c:if test="${type == 2 }">
					<c:choose>
 					<c:when test="${pageType == 1 }">
						<h4>编辑帮助手册</h4>
 					</c:when>
 					<c:when test="${pageType == 2 }">
 						<h4>编辑报修信息</h4>
 					</c:when>
 					</c:choose>
		        </c:if>
	      </div>
			<div>
				<a style="float:right;margin-right: 20px;margin-top: -2px;" title="关闭" onclick="cancel();"><img src="${ctx}/images/new_close.png" /></a>
			</div>
		</div>	      					
			<div id="form" class="form" style="min-height:350px;">
				<div class="itemEditMap">
					<input id="helpId" type="hidden" value="${helpManual.id }">
					<input id="pageType" type="hidden" value="${pageType }">
					<input id="imageLogo" type="hidden" value="${helpManual.logo }">
					<span class="col-sm-1 editlableEditMap">图像：</span>
					<div class="flEditMap" style="margin-top:25px;">
					
						<c:if test="${helpManual.logo == null || helpManual.logo == ''}">
								<img id="preview3" style="width:150px;height:150px;float:left;" title="快上传小区头像吧" src="${ctx}/images/default.jpg" />
						</c:if>
						<c:if test="${helpManual.logo != null && helpManual.logo != ''}">
							<img id="preview3" style="width:150px;height:150px;float:left;" src="${sessionScope.image_logo}${helpManual.logo}" />
						</c:if>
						<div class="mtjxsa" style="float:left;margin-top: 40px;">
							  <p style="text-align: left" id="imageBtn">
								  <input type="hidden" name="imageLogoUrl" id="imageLogoUrl" />
								  <label class="lbl">提示：只能上传.jpg, .png的图片格式,照片文件大小最大为10MB</label>
							  </p>
							  <div>
						    	  <div class="fl">
						    		  <button style="width:100px;height:30px;background-color: #593505;color: #fff;border: 0px;" class="acblu tctpsc">上传头像</button>
						          </div>
						      </div>
						  </div>
						<%@include file="/views/common/uploader/picture.jsp" %>
					</div>
				</div>
				<div class="itemEdit">
					<input id="helpId" type="hidden" value="${helpManual.id }">
					<span class="col-sm-1 editlableEdit">标题：</span>
					<div class="flEdit">
						<input class="controlEdit" id="title" value="${helpManual.title }" type="text"  class="text" maxlength="20" placeholder="请输入标题（最多25字）"/>
						<em style="color:red;">*</em>
					</div>
				</div>
				<div class="itemEdit">
                  <label class="col-sm-1 editlableEdit">小区名：</label>
                  <div class="flEdit">
	                  <c:if test="${helpManual.id == null}">
	                      <select class="editform-control" id="cellId" style="height: 30px; width: 140px;">
	                      <option value="" <c:if test="${cellId == null }">selected="selected"</c:if>>全部</option> 
	                      <c:forEach items="${cellInfos}" var="item" varStatus="cStatus">
								<option value="${item.id}"  <c:if test="${item.id == manualCellId}">selected="selected"</c:if>>${item.cellName}</option>
						  </c:forEach>
	                      </select>
	                  </c:if>
	                  <c:if test="${helpManual.id != null}">
	                  	  <c:forEach items="${cellInfos}" var="item" varStatus="cStatus">
								<c:if test="${item.id == manualCellId}"><input class="controlEdit" style="width:164px;" type="text" disabled="disabled" value="${item.cellName}"></c:if>
						  </c:forEach>
	                  </c:if>
	                  <em class="emStyle">*</em>
                  </div>
	            </div>
	            <div class="itemEdit">
					<span class="col-sm-1 editlableEdit">排序：</span>
					<div class="flEdit">
						<input  class="sortEdit" id="sort" onblur="checkSort();" type="number"maxlength="11" value="${helpManual.sort}">
					</div>
				</div>
				<div class="editorDetail">内容：</div>
				<div style="height:auto;min-height: 261px;">
				<div id="ueditor" >
					<!-- <textarea name="content" id="ideaContent" style="width:537px;height:100px;resize:none" class="itxt" maxlength="200" required></textarea> -->
					
					<!-- 加载编辑器的容器 -->
				    <script id="container" type="text/plain" >${helpManual.answer}</script>
					<!-- 配置文件 -->
					<script type="text/javascript" src="${ctx }/js/lib/ueditor/ueditor.config.js"></script>
					<!-- 编辑器源码文件 -->
					<script type="text/javascript" src="${ctx }/js/lib/ueditor/ueditor.all.js"></script>
					<script type="text/javascript" src="${ctx }/js/lib/ueditor/ueditor.parse.js"></script>
					<!-- 实例化编辑器 -->
					<script type="text/javascript">


					var ue = UE.getEditor('container',{
						toolbars : [
							       	  ['fontfamily','fontsize', '|', 'blockquote', 'horizontal', '|', 'removeformat', '|', 'insertimage'],
							       	  ['bold', 'italic', 'underline', 'forecolor', 'backcolor', '|',
							       	   'justifyleft', 'justifycenter', 'justifyright', '|',
							       	   'rowspacingtop', 'rowspacingbottom', 'lineheight', '|',
							       	   'insertorderedlist', 'insertunorderedlist', '|',
							       	   'imagenone', 'imageleft', 'imageright', 'imagecenter','autotypeset','cleardoc','source'
							       	   ]
							       	],
						UEDITOR_HOME_URL: '${ctx}/js/lib/ueditor/',
						serverUrl: '${ctx}/fileHandler/upLoaderMergeForUeditor',
						imageUrlPrefix: '${sessionScope.image_logo}',
						imageActionName: 'uploadimage',
						imageFieldName: 'file',
						imageMaxSize: 1024000,
						imageAllowFiles: ['.png', '.jpg', '.jpeg', '.gif'],
						initialFrameHeight: 200,
						initialFrameWidth: '99.86%',
						elementPathEnabled: false,
						retainOnlyLabelPasted:true,
						wordCount: false,
						/* sourceEditor: 'textarea', */
						insertorderedlist: {
							// 系统自带
							'decimal': '',     // '1,2,3...'
							'lower-alpha': '', // 'a,b,c...'
							'lower-roman': '', // 'i,ii,iii...'
							'upper-alpha': '', // 'A,B,C'
							'upper-roman': ''  // 'I,II,III...'
						},
						insertunorderedlist : {
							// 系统自带
							'circle': '',  // '○ 小圆圈'
							'disc': '',    // '● 小圆点'
							'square': ''   // '■ 小方块'
						},
						listDefaultPaddingLeft: '50'
					});
						</script>
			</div>
        	</div>

		<div class="foot">
			<div style="float:left;margin-left:40%;">
				<button class="buttonCancle" onclick="cancel();">取&nbsp;&nbsp;消</button>
			</div>
			<div style="float:left;padding-left:1%;">
				<button class="buttonEdit" onclick="saveHelpManual();">保&nbsp;&nbsp;存</button>
			</div>
		</div>
   </div>
		<%@include file="/views/common/footer.jsp"%>
			</div>
		</section>
    <script type="text/javascript">
		var ctx = '${ctx}';
		setCtx(ctx);
	</script>  
	
	<!-- 解决ie 6 7 8 9不能显示placeholder的问题 -->
	<script src="${ctx}/js/lib/jquery.JPlaceholder.js"></script>           
